﻿@model DMS.Models.CategoryModel

@{
    ViewBag.Title = "Thêm mới chuyên mục";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>Thêm mới chuyên mục</h2>
                
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                @using (Html.BeginForm("CategoryAdd", "Admin", FormMethod.Post, new { id = "form_categoryadd", @class = "form-horizontal form-label-left", role = "form"}))
                { 
                    @Html.AntiForgeryToken()
                    @Html.ValidationSummary(true)
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                            Tên chuyên mục <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            @Html.TextBoxFor(model => model.CategoryName, new { @class = "form-control col-md-7 col-xs-12" })
                            @Html.ValidationMessageFor(model => model.CategoryName)
                            @*<input id="name" class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2" name="name" placeholder="both name(s) e.g Jon Doe" required="required" type="text">*@
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                            Mô tả
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            @Html.TextBoxFor(model => model.CategoryDescription, new { @class = "form-control col-md-7 col-xs-12" })
                            @Html.ValidationMessageFor(model => model.CategoryDescription)
                            @*<input id="name" class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2" name="name" placeholder="both name(s) e.g Jon Doe" required="required" type="text">*@
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                            Chuyên mục cha
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            @Html.DropDownListFor(m => m.CategoryParentId, Model.Categories, new { @class = "form-control col-md-7 col-xs-12", @onchange = "GetHotspots()" })
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">
                            Trạng thái
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <div class="checkbox">
                                <label>
                                    @Html.CheckBoxFor(model => model.CategoryActive, new { @class = "flat" })
                                </label>
                            </div>
                        </div>
                    </div>
                    @Html.TextBoxFor(model => model.CategoryId, new { @class = "hidden" })
                    <div class="ln_solid"></div>
                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                            <button id="send" type="submit" class="btn btn-success">@ViewBag.ButtonName</button>
                           
                        </div>
                    </div>
                
                }
            </div>
        </div>
    </div>
</div>

<div>
    @Html.ActionLink("Danh sách chuyên mục", "categories","admin")
</div>

@section Scripts {
    
}
